<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>编辑商品</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="__STATIC__/extends/AmazeUI-2.7.2/css/amazeui.css">
    <link href="__STATIC__/css/base.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="__STATIC__/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="__STATIC__/layuiadmin/style/admin.css" media="all">
    <script type="text/javascript" src="__STATIC__/js/jquery-1.11.3.min.js"></script>
    <script src="__STATIC__/extends/AmazeUI-2.7.2/js/amazeui.min.js"></script>
    <link rel="stylesheet" href="__STATIC__/css/seller.css">
    <link rel="stylesheet" href="__STATIC__/css/member.css">
    <link rel="stylesheet" href="__STATIC__/css/seller_goods.css">
    <script src="__STATIC__/js/common1.js"></script>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header">
            编辑商品
        </div>
        <div class="layui-card-body" style="padding: 15px;">
            <form class="layui-form" id="frommsg" lay-filter="component-form-group" enctype="multipart/form-data">
                <input type="hidden" name="id" value="{$goods['id']}"/>
                <div class="layui-form-item">
                    <label class="layui-form-label">商品名称：</label>
                    <div class="layui-input-block formControls">
                        <input type="text" onblur="" value="{$goods['goods_name']}" id="goods_name" lay-verify="title" autocomplete="off" placeholder="商品名称名称不能为空！" name="goods_name" class="layui-input">
                        <span class="Validform_checktip"></span>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label"><span class="red">*</span>商品分类：</label>
                    <div class="layui-input-inline">
                        <select name="goodscateid" lay-verify="required">
                            <option value="0">请选择商品分类</option>
                            {volist name="goodscate" id="vo"}
                            <option {if $goods['goodscateid'] == $vo.gcate_id}selected{/if} value="{$vo['gcate_id']}">{$vo.goodscaname|raw}</option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div style="margin-top: 2%"></div>
                <div class="layui-form-item">
                    <label class="layui-form-label">软件大小：</label>
                    <div class="layui-input-block formControls">
                        <input type="text"  value="{$goods['softsize']}" id="softsize" lay-verify="title" autocomplete="off" placeholder="请输入软件大小！" name="softsize" class="layui-input">
                        <span class="Validform_checktip"></span>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label" style="margin-top:8px">源码类型：</label>
                    <div class="layui-input-inline" style="margin-top:10px">
                        <select name="type_id" lay-verify="required">
                            <option value="0">请选择详情模版</option>
                            {volist name="type_id" id="vo"}
                            <option {if $goods['type_id'] eq $vo['attrg_id']} selected {else} {/if} value="{$vo['attrg_id']}">{$vo.attrg_name}
                            </option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label" style="margin-top:8px">开发语言：</label>
                    <div class="layui-input-inline" style="margin-top:10px">
                        <select name="language_id" lay-verify="required">
                            <option value="0">请选择详情模版</option>
                            {volist name="language_id" id="vo"}
                            <option {if $goods['language_id'] eq $vo['attrg_id']} selected {else} {/if} value="{$vo['attrg_id']}">{$vo.attrg_name}
                            </option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label" style="margin-top:8px">开发品牌：</label>
                    <div class="layui-input-inline" style="margin-top:10px">
                        <select name="brand_id" lay-verify="required">
                            <option value="0">请选择详情模版</option>
                            {volist name="brand_id" id="vo"}
                            <option {if $goods['brand_id'] eq $vo['attrg_id']} selected {else} {/if} value="{$vo['attrg_id']}">{$vo.attrg_name}
                            </option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label" style="margin-top:8px">是否加密：</label>
                    <div class="layui-input-inline" style="margin-top:10px">
                        <select name="encrypt_id" lay-verify="required">
                            <option value="0">请选择详情模版</option>
                            {volist name="encrypt_id" id="vo"}
                            <option {if $goods['encrypt_id'] eq $vo['attrg_id']} selected {else} {/if} value="{$vo['attrg_id']}">{$vo.attrg_name}
                            </option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label" style="margin-top:8px">是否授权：</label>
                    <div class="layui-input-inline" style="margin-top:10px">
                        <select name="auth_id" lay-verify="required">
                            <option value="0">请选择详情模版</option>
                            {volist name="auth_id" id="vo"}
                            <option {if $goods['auth_id'] eq $vo['attrg_id']} selected {else} {/if} value="{$vo['attrg_id']}">{$vo.attrg_name}
                            </option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label" style="margin-top:8px">规格：</label>
                    <div class="layui-input-inline" style="margin-top:10px">
                        <select name="specific_id" lay-verify="required">
                            <option value="0">请选择详情模版</option>
                            {volist name="specific_id" id="vo"}
                            <option {if $goods['specific_id'] eq $vo['attrg_id']} selected {else} {/if} value="{$vo['attrg_id']}">{$vo.attrg_name}
                            </option>
                            {/volist}
                        </select>
                    </div>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label" style="margin-top:8px">数据库：</label>
                    <div class="layui-input-inline" style="margin-top:10px">
                        <select name="database_id" lay-verify="required">
                            <option value="0">请选择详情模版</option>
                            {volist name="database_id" id="vo"}
                            <option {if $goods['database_id'] eq $vo['attrg_id']} selected {else} {/if} value="{$vo['attrg_id']}">{$vo.attrg_name}
                            </option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div style="margin-top: 2%">
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">开发布局:</label>
                    <div class="layui-input-block">
                        {foreach name="layout_id" as item="v"}
                        <input {if in_array($v['attrg_id'],$goods['layout_arr'])} checked="" {/if} type="checkbox" name="layout_id[]" value="{$v.attrg_id}" title="{$v.attrg_name}">
                        {/foreach}
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="red">*</span>售价</label>
                    <div class="layui-input-block delivery" id="spec_price_tab">
                        <strong class="change {if $goods['is_spec'] lt 1 }current{/if}">
                            <input name="is_spec" type="radio" value="0" id="is_spec" class="is_spec" {if $goods['is_spec'] lt 1 } checked="" {/if} title="一口价" autocomplete="off">
                            <div class="layui-unselect layui-form-radio {if $goods['is_spec'] lt 1 } layui-form-radioed {/if}">
                                <i class="layui-anim layui-icon {if $goods['is_spec'] lt 1 } layui-anim-scaleSpring {/if} "></i>
                                <div>
                                    一口价
                                </div>
                            </div>
                        </strong>
                        <strong class="change {if $goods['is_spec'] eq 1 }current{/if}">
                            <input name="is_spec" type="radio" value="1" id="is_spec" class="is_spec" {if $goods['is_spec'] eq 1 } checked="" {/if} title="套餐价格" autocomplete="off">
                            <div class="layui-unselect layui-form-radio {if $goods['is_spec'] eq 1 } layui-form-radioed {/if}">
                                <i class="layui-anim layui-icon {if $goods['is_spec'] eq 1 } layui-anim-scaleSpring {/if} "></i>
                                <div>
                                    套餐价格
                                </div>
                            </div>
                        </strong>
                        <div class="change_box">
                            <div id="spec_auto_delivery" class="box" style="display: {if $goods['is_spec'] lt 1 } block;{else} none;{/if}">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">一口价</label>
                                    <div class="layui-input-inline">
                                        <input class="layui-input" name="goods_price" value="{$goods['goods_price']}" id="goods_price" maxlength="8" type="text">
                                    </div>
                                    <div class="layui-form-mid layui-word-aux">
                                        元 (不低于30元)
                                    </div>
                                </div>
                            </div>
                            <div id="spec_manual_delivery" class="box none" style="display: {if $goods['is_spec'] eq 1 } block;{else} none;{/if}">
                                <div class="box" style="margin-top: -5px;">
                                    <table class="tablelist moneylist" style=" border-left:none;border-right:none; ">
                                        <thead>
                                        <tr>
                                            <td width="50%" style="border:0">
                                                套餐名称
                                            </td>
                                            <td width="30%" style="border:0">
                                                价格（元）
                                            </td>
                                            <td width="20%" style="border:0">
                                                操作
                                            </td>
                                        </tr>
                                        </thead>
                                        <tbody id="pkg-price-list" class="pkg-price-list">
                                        {foreach name="c" as item="vo"}
                                        <tr class="pkg-price">
                                            <td>
                                                <input name="spec_name[]" class="layui-input t-label checkLen" d_len="8" placeholder="请输入套餐名称，不能超过20字符" maxlength="20" value="{$key}" type="text">
                                            </td>
                                            <td>
                                                <input name="spec_price[]" class="layui-input s o_number t-no checkLen" placeholder="请输入套餐价格"  maxlength="8" d_len="4" value="{$vo}" type="text">
                                            </td>
                                            <td>
                                                <a class="del-price">删除</a>
                                            </td>
                                        </tr>
                                        {/foreach}
                                        </tbody>
                                        <tfoot>
                                        <tr>
                                            <td colspan="4">
                                                <a class="addmoney">添加套餐</a>
                                            </td>
                                        </tr>
                                        </tfoot>
                                    </table>
                                    <div class="notes">
                                        <li>
                                            <h3> 动态价格说明：</h3>
                                        </li>
                                        <li><b>1.</b>【动态价格】最多可设置5条，至少需要设置1条；</li>
                                        <li><b>2.</b>【套餐名称】套餐名称默认最长20字符；</li>
                                        <li><b>3.</b>【套餐价格】不允许出现重复值，【价格】不低于30元；</li>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <label class="layui-form-label"></label>
                        <input type="hidden" name="goods_type" value="1">
                    </div>
                    <script>
                        $("#spec_price_tab").children(".change").click(function() {
                            var index = $(this).index();
                            $(this).addClass("current").siblings().removeClass("current");
                            if (index == 1) {
                                $("#spec_auto_delivery").hide();
                                $("#spec_manual_delivery").show();
                            } else {
                                $("#spec_auto_delivery").show();
                                $("#spec_manual_delivery").hide();
                            }
                        })

                        //添加一口价套餐价格
                        $(document).on('click','.del-price',function(){
                            if($(".moneylist tbody tr").size()>1){
                                $(this).parent().parent().remove();
                            }
                        });
                        //添加套餐价格
                        $(".addmoney").click(function () {
                            var length = $(".moneylist tbody tr").length;
                            if(length < 5 ){
                                var html = ' <tr class="pkg-price"><td><input name="spec_name[]" class="layui-input t-label checkLen" placeholder="请输入套餐名称，不能超过20字符" d_len="8" maxlength="20" value="" type="text"></td>';
                                html += '<td><input name="spec_price[]" class="layui-input s o_number t-no checkLen" placeholder="请输入套餐价格" onkeyup="this.value= this.value.match(/\\d+(\\.\\d{0,2})?/) ? this.value.match(/\\d+(\\.\\d{0,2})?/)[0] : \'\'"  maxlength="8" d_len="4" value="" type="text"></td>';
                                html += '<td><a  class="del-price"   >删除</a></td> </tr>';
                                $(".moneylist tbody ").append(html);
                            }else{
                                layer.msg("亲,不能添加了");
                            }
                        });

                    </script>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">描述：</label>
                    <div class="layui-input-block">
                        <textarea autocomplete="off" lay-verify="description" name="desc" placeholder="描述不能少于20个字符" class="layui-textarea">{$goods['desc']}</textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-from-label">
                        <i class="must">*</i>商品详情
                    </div>
                    <div class="layui-input-block">
                        <textarea id="ueditor" name="gcontent" type="text">{$goods.gcontent}</textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">封面图:</label>
                    <div class="layui-upload">
                        <button type="button" class="layui-btn" id="test1">上传图片</button>
                        <div class="layui-upload-list">
                            <img class="layui-upload-img" src="{$goods['image']}" style="width:120px;margin-left:10rem" id="demo1">
                            <input type="hidden" value="{$goods['image']}" name="image" id="image"/>
                            <p id="demoText">
                            </p>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">演示网址</label>
                    <div class="layui-input-inline">
                        <input id="demo_url" name="demo_web" class="layui-input" style="width:400px" maxlength="100" type="text" autocomplete="off" value="{$goods['demo_web']}" placeholder="必须以http(s)开头"/>
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                        <span class="Validform_checktip"></span>
                    </div>
                    <input type="checkbox" name="is_demo_remarks" value="{$goods['is_demo_remarks']}" key="ys_remarks" lay-skin="primary" lay-filter="checkbox" {if $goods['demo_remark']} checked="" {/if} title="备注">
                    <input type="checkbox" name="is_demo_img" value="1" key="ys_remarks_img" lay-skin="primary" lay-filter="checkbox" title="演示图片" {if $goods['demo_qrcode']} checked="" {/if}>
                </div>
                <div class="layui-form-item lb_li ys_remarks" style="display: {if $goods['demo_remark']} {else}none{/if}">
                    <label class="layui-form-label">演示备注</label>
                    <div class="layui-input-inline" style="width:300px">
                        <textarea id="demo_remark" name="demo_remark"style="height:30px;min-height: 50px;"autocomplete='off' class="layui-textarea">{$goods['demo_remark']}</textarea>
                    </div>
                </div>
                <div class="layui-form-item lb_li ys_remarks_img" style="display: {if $goods['demo_qrcode']} {else}none{/if}">
                    <div class="layui-form-item">
                        <label class="layui-form-label">演示二维码:</label>
                        <div class="layui-upload">
                            <button type="button" class="layui-btn" id="test2">演示二维码</button>
                            <div class="layui-upload-list">
                                <img class="layui-upload-img" src="{$goods['demo_qrcode']}" style="width:120px;margin-left:10rem" id="demo2">
                                <input type="hidden" value="{$goods['demo_qrcode']}" name="demo_qrcode" id="demo_qrcode"/>
                                <p id="demoTextt">
                                </p>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">安装服务</label>
                    <div class="layui-input-block delivery" id="installing">
                        <strong class="change {if $goods['installing'] lt 1 } current {/if}">
                            <input name="installing" type="radio" value="0" {if $goods['installing'] lt 1 } checked="" {/if} title="免费安装" autocomplete="off">
                            <div class="layui-unselect layui-form-radio {if $goods['installing'] lt 1 } layui-form-radioed {/if} ">
                                <i class="layui-anim layui-icon {if $goods['installing'] lt 1 } layui-anim-scaleSpring {/if}"></i>
                                <div>
                                    免费安装
                                </div>
                            </div>
                        </strong>
                        <strong class="change {if $goods['installing'] eq 1 } current {/if}">
                            <input name="installing" type="radio" value="1" title="收费安装" autocomplete="off" {if $goods['installing'] eq 1 } checked="" {/if}>
                            <div class="layui-unselect layui-form-radio {if $goods['installing'] eq 1 } layui-form-radioed {/if}">
                                <i class="layui-anim layui-icon {if $goods['installing'] eq 1 } layui-anim-scaleSpring {/if}"></i>
                                <div>
                                    收费安装
                                </div>
                            </div>
                        </strong>
                        <div class="change_box">
                            <div style="display: {if $goods['installing'] eq 1 } {else} none; {/if}" class="box" id="install_money">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">安装费用</label>
                                    <div class="layui-input-inline" style="width:100px;">
                                        <input name="install_cost" value="{$goods['install_cost']}" class="layui-input s o_number" maxlength="8" size="8" type="text" autocomplete="off">
                                    </div>
                                    <div class="layui-form-mid layui-word-aux">
                                        <span class="Validform_checktip"></span>
                                        元
                                        <font class="gray">（安装费不能超过200元！）</font>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-form-item icheckbox">
                                <label class="layui-form-label" id="host"><span class="red">*</span> 主机类型</label>
                                <div class="layui-input-block">
                                    <!--{if $goods['host_type'] } {if $goods['host_type'] eq "独立主机（服务器、VPS、VM）"} checked=""  {else}  {/if}-->
                                    <input   {if in_array('独立主机（服务器、VPS、VM）',$goods['hosttype_arr'])}  checked=""  {/if}  type="checkbox" name="host_type[]" value="独立主机（服务器、VPS、VM）"  title="独立主机（服务器、VPS、VM）">

                                    <input {if in_array('虚拟主机（仅有FTP管理）',$goods['hosttype_arr'])}  checked=""  {/if} type="checkbox" name="host_type[]" value="虚拟主机（仅有FTP管理）"  title="虚拟主机（仅有FTP管理）" >

                                </div>
                            </div>
                            <div class="layui-form-item icheckbox">
                                <label class="layui-form-label" id="system"><span class="red">*</span> 操作系统</label>
                                <div class="layui-input-block">
                                    <input   {if in_array('Windows',$goods['operation_arr'])}  checked=""  {/if} type="checkbox" name="operation[]" value="Windows" title="Windows">
                                    <input  {if in_array('Linux',$goods['operation_arr'])}  checked=""  {/if}  type="checkbox" name="operation[]" value="Linux" title="Linux" >
                                    <input  {if in_array('MAC',$goods['operation_arr'])}  checked=""  {/if}  type="checkbox" name="operation[]" value="MAC" title="MAC" >
                                    <input  {if in_array('UNIX',$goods['operation_arr'])}  checked=""  {/if}  type="checkbox" name="operation[]" value="UNIX" title="UNIX" >
                                    <input  {if in_array('Solaris',$goods['operation_arr'])}  checked=""  {/if}  type="checkbox" name="operation[]" value="Solaris" title="Solaris" >
                                </div>
                            </div>
                            <div class="layui-form-item icheckbox">
                                <label class="layui-form-label" id="server"><span class="red">*</span> web服务</label>
                                <div class="layui-input-block">
                                    <input    {if in_array('apache',$goods['service_arr'])}  checked=""  {/if}  type="checkbox" name="service[]" value="apache" title="apache" >
                                    <input  {if in_array('Nginx',$goods['service_arr'])}  checked=""  {/if}  type="checkbox" name="service[]" value="Nginx" title="Nginx" >
                                    <input {if in_array('IIS',$goods['service_arr'])}  checked=""  {/if}  type="checkbox" name="service[]" value="IIS" title="IIS" >
                                    <input  {if in_array('tomcat',$goods['service_arr'])}  checked=""  {/if}  type="checkbox" name="service[]" value="tomcat" title="tomcat" >
                                    <input  {if in_array('jboss',$goods['service_arr'])}  checked=""  {/if} type="checkbox" name="service[]" value="jboss" title="jboss" >
                                    <input  {if in_array('Weblogic',$goods['service_arr'])}  checked=""  {/if}  type="checkbox" name="service[]" value="Weblogic" title="Weblogic" >
                                    <input  {if in_array('other',$goods['service_arr'])}  checked=""  {/if} type="checkbox" name="service[]" value="other" title="other" >
                                </div>
                            </div>
                            <div class="layui-form-item icheckbox">
                                <label class="layui-form-label" id="install"><span class="red">*</span> 安装方式</label>
                                <div class="layui-input-block">
                                    {if $goods['install_mode'] eq "提供管理权限"}
                                    <input type="radio" name="install_mode" checked="" value="提供管理权限" title="提供管理权限">
                                    <input type="radio" name="install_mode" value="远程协助" title="远程协助">
                                    {else}
                                    <input type="radio" name="install_mode" value="提供管理权限" title="提供管理权限">
                                    <input type="radio" name="install_mode" checked="" value="远程协助" title="远程协助">
                                    {/if}
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">伪静态</label>
                                <div class="layui-input-block">
                                    {if $goods['static'] eq 1}
                                    <input type="radio" name="static" value="1" title="需要" checked="">
                                    <input type="radio" name="static" value="2" title="不需要">
                                    {else}
                                    <input type="radio" name="static" value="1" title="需要">
                                    <input type="radio" name="static" value="2" checked title="不需要">
                                    {/if}
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">备注说明</label>
                                <div class="layui-input-inline" style="width:380px;">
                                    <textarea id="remark_explain" name="remark_explain"style="height:30px;min-height: 50px;"autocomplete='off' class="layui-textarea">{$goods['remark_explain']}</textarea>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">发货方式</label>
                    <div class="layui-input-block delivery" id="delivery_area">
                        <strong class="change curren current">
                            <input name="deliver_type" type="radio" value="1" checked="" title="自动发货" autocomplete="off">
                            <div class="layui-unselect layui-form-radio layui-form-radioed">
                                <i class="layui-anim layui-icon layui-anim-scaleSpring"></i>
                                <div>
                                    自动发货
                                </div>
                            </div>
                        </strong>
                        <strong class="change">
                            <input name="deliver_type" type="radio" value="0" title="手动发货" autocomplete="off">
                            <div class="layui-unselect layui-form-radio">
                                <i class="layui-anim layui-icon"></i>
                                <div>
                                    手动发货
                                </div>
                            </div>
                        </strong>
                        <div class="change_box">
                            <div id="auto_delivery" class="box" style="display: block;">
                                <div class="layui-form-item">
                                    <label class="layui-form-label"><span class="red">*</span> 网盘地址</label>
                                    <div class="layui-input-inline" style="width:400px;">
                                        <input name="skydrive_web" class="layui-input" style="width:400px" maxlength="100" datatype="url" value="{$goods['skydrive_web']}" nullmsg="演示网址不能为空！" errormsg="演示网址不正确！" type="text" autocomplete="off" placeholder="必须以http(s)开头">
                                    </div>
                                    <div class="layui-form-mid layui-word-aux">
                                        <span class="Validform_checktip"></span>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label"> 网盘密码</label>
                                    <div class="layui-input-inline" style="width:400px;">
                                        <input id="download_url_pwd" name="skydrive_password" class="layui-input" style="width:400px" maxlength="100" value="{$goods['skydrive_password']}" type="text" autocomplete="off" placeholder="请输入网盘的密码">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label"> 下载备注</label>
                                    <div class="layui-input-inline" style="width:400px;">
                                        <textarea id="download_remark" name="download_remark"style="height:30px;min-height: 50px;" autocomplete='off' placeholder="可输入解压密码等备注信息" class="layui-textarea">{$goods['download_remark']}</textarea>
                                    </div>
                                </div>
                                <div class="layui-form-item ">
                                    <div class="notes">
                                        <ul>
                                            <li>
                                                <h3> 自动发货说明：</h3>
                                            </li>
                                            <li><b>1.</b>请填写源码下载地址，买家拍下后，将获取此地址下载您的源码；</li>
                                            <li><b>2.</b>推荐使用【<a href="http://pan.baidu.com/" target="_blank">百度网盘</a>】、【<a href="http://www.weiyun.com/disk/index.html" target="_blank">腾讯微云</a>】等网盘进行外链下载；也可以使用您自己的网站下载地址；</li>
                                            <li><b>3.</b>自动发货默认交易完成时间为1天</li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                            <div id="manual_delivery" class="none" style="display: none;">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">联系Q Q</label>
                                    <div class="layui-input-inline">
                                        <div class="layui-form-mid">
                                            2693346620
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">联系电话</label>
                                    <div class="layui-input-inline">
                                        <div class="layui-form-mid">
                                            15359209361
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="notes">
                                        <ul>
                                            <li>
                                                <h3>手动发货说明：</h3>
                                            </li>
                                            <li><b>1.</b>若下载源码有提取码或解压密码请填写；</li>
                                            <li><b>2.</b>买家拍下后会通过以上联系方式联系您取货，这样可能会影响买家延迟确认收货；</li>
                                            <li><b>3.</b>建议如实填写联系电话，避免长时外出而致使买家退款。</li>
                                            <li><b>4.</b>若需修改联系电话、QQ，可前往【<a href="" target="_blank">客服设置</a>】、【<a href="" target="_blank">安全中心</a>】修改。</li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">是否启用：</label>
                    <div class="layui-input-block">
                        <input type="radio" name="goods_status" value="1" checked title="是">
                        <input type="radio" name="goods_status" value="0" title="否">
                    </div>
                </div>
                <div class="layui-form-item layui-layout-admin">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0;">
                            <button class="layui-btn" lay-submit="" id="btn" lay-filter="component-form-demo1">立即提交</button>
                            <a href="{:url('goods/index')}" class="layui-btn layui-btn-primary">返回</a>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script src="__STATIC__/extends/js/jquery-ui.js"></script>
<script type="text/javascript" src="__STATIC__/extends/ueditor/1.4.3/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__STATIC__/extends/ueditor/1.4.3/ueditor.all.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UE.getEditor('ueditor', {
        initialFrameHeight: 500,
        initialFrameWidth: 'auto',
    });
</script>
<script src="__STATIC__/extends/layui2.4.5/layui.all.js "></script>
<script src="__STATIC__/extends/Validform/5.3.2/Validform.min.js "></script>
<script type="text/javascript">
    $(function() {
        //表单验证
        $("form").Validform({
            tiptype:function(msg,o,cssctl){
                if(!o.obj.is("form")){
                    //默认表单
                    var objtip=o.obj.parents(".formControls").find(".Validform_checktip");
                    cssctl(objtip,o.type);
                    objtip.text(msg);
                }
            },
            showAllError:true
        })
    });
</script>
<script src="__STATIC__/layuiadmin/layui/layui.js"></script>
<script>
    // $("#goods_name").blur(function(){
    //   var data = $("#goods_name").val();
    //       if(data == ''){
    //              layer.msg('名称不可为空');
    //              setTimeout(function(){
    //
    //                      window.location.reload();
    //                 },2000);
    //
    //       }else{
    //        $.ajax({
    //         url : "{:url('Goods/blurGoods')}",
    //         type:'post',
    //         data:{data:data},
    //         datatype:'JSON',
    //         success:function(res){
    //             if(res.code == 00){
    //
    //                 layer.msg(res.msg);
    //                 setTimeout(function(){
    //                   window.location.reload();
    //
    //                 },2000);
    //
    //             }
    //          }
    //         })
    //       }
    // });
    layui.use('upload', function(){
        var $ = layui.jquery
            ,upload = layui.upload;
        //普通图片上传
        var uploadInst = upload.render({
            elem: '#test1'
            ,url: '{:url("Goods/addGoodsimg",["type"=>"upload"])}' //改成您自己的上传接口
            ,accept:'file'
            // ,acceptMime:'image/*'
            // ,exts:'jpg|jpeg|png'
            // ,method:'POST'
            ,done: function(res){
                //如果上传失败
                if(res.code > 0){
                    return layer.msg('上传失败');
                }else{
                    $('#image').val(res.path);
                    $('#demo1').attr('src', res.path);
                    //alert(res.path);
                }
                //上传成功
            }
            ,error: function(){
                //演示失败状态，并实现重传
                var demoTextt = $('#demoTextt');
                demoTextt.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
                demoTextt.find('.demo-reload').on('click', function(){
                    uploadInst.upload();
                });
            }
        });
    });
    layui.use('upload', function(){
        var $ = layui.jquery
            ,upload = layui.upload;
        //普通图片上传
        var uploadInst = upload.render({
            elem: '#test2'
            ,url: '{:url("Goods/addGoodsimg",["type"=>"upload"])}' //改成您自己的上传接口
            ,accept:'file'
            // ,acceptMime:'image/*'
            // ,exts:'jpg|jpeg|png'
            // ,method:'POST'
            ,done: function(res){
                //如果上传失败
                if(res.code > 0){
                    return layer.msg('上传失败');
                }else{
                    $('#demo_qrcode').val(res.path);
                    $('#demo2').attr('src', res.path);
                    //alert(res.path);
                }
                //上传成功
            }
            ,error: function(){
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
                demoText.find('.demo-reload').on('click', function(){
                    uploadInst.upload();
                });
            }
        });
    });
    $('#btn').click(function(){
        var data = $("#frommsg").serialize();
        $.ajax({
            url : "{:url('Goods/addGoodss')}",
            type:'post',
            data:data,
            datatype:'JSON',
            success:function(res){
                // if(res.code == 0){
                //     layer.msg('更新成功');
                //     setTimeout(function(){
                //         window.history.back();
                //     },2000);
                // }else if(res.code == 1){
                //     layer.msg(res.msg);
                // }else{
                //     layer.msg('更新失败');
                //     setTimeout(function(){
                //         window.history.back();
                //     },2000);
                // }
                if (res.code === 0) {
                    setTimeout(function () {
                        history.go(-1);
                    }, 1000);
                }else {
                    layer.msg(res.msg, {icon: 2, anim: 6, time: 1000,shade: [0.8, '#393D49']});
                }
            }
        })
    })
</script>
<script>
    layui.config({
        base: '__STATIC__/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'laydate'], function(){
        var $ = layui.$
            ,admin = layui.admin
            ,element = layui.element
            ,layer = layui.layer
            ,laydate = layui.laydate
            ,form = layui.form
            ,upload = layui.upload;
        form.render(null, 'component-form-group');
        laydate.render({
            elem: '#LAY-component-form-group-date'
        });
    });
    layui.use(['form'], function() {
        var form = layui.form; //日期
        form.on('checkbox(checkbox)', function(data){
            var key = $(data.elem).attr("key");
            if(data.elem.checked === true){
                $("."+key).show();
            }else{
                $("."+key).hide();
            }
        });
    })
</script>
<script>
    $(function() {
        //剪切插件
        //安装服务切换
        $("#installing").children("strong").click(function() {
            var index = $(this).index();
            $(this).addClass("current").siblings().removeClass("current");
            if (index == 1) {
                $("#install_money").show();
            } else {
                $("#install_money").hide();
            }
        })
        //发货方式切换
        $("#delivery_area").children(".change").click(function() {
            var index = $(this).index();
            $(this).addClass("current").siblings().removeClass("current");
            if (index == 1) {
                $("#auto_delivery").hide();
                $("#manual_delivery").show();
            } else {
                $("#auto_delivery").show();
                $("#manual_delivery").hide();
            }
        })
    });
</script>
</body>
</html>